﻿@{
    Layout = null;
}
@using WXDba.Entity
@using WXDba.Abstract
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>中秋夜月饼投票赛</title>
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    <script src="~/scripts/jquery-1.10.2.min.js"></script>
    <script src="~/scripts/bootstrap.min.js"></script>
    <link href="~/Content/ZhouQiu.css" rel="stylesheet" />
</head>
<body>
    <div class="container">
        <div class="top">
            <img src="~/Content/Images/top.png" />
        </div>
        <div class="center">
            <div class="row">
                <div class="col-md-6 col-sm-12">
                    <div class="thumbnail">
                        <img src="/content/images/五仁月饼.jpg" />
                        <div class="caption">
                            <h3>五仁月饼</h3>
                            <p>
                                <a class="btn btn-primary" role="button">
                                    喜欢
                                </a>
                                <a class="btn btn-default" role="button">
                                    不喜欢
                                </a>
                                <a class="btn btn-primary" role="button">
                                    吃过
                                </a>
                                <a class="btn btn-default" role="button">
                                    没吃过
                                </a>
                            </p>
                        </div>
                    </div>
                </div>
                <div class="col-md-6 col-sm-12">
                    <div class="thumbnail">
                        <img src="/content/images/水果月饼.jpg" />
                        <div class="caption">
                            <h3>水果月饼</h3>
                            <p>
                                <a class="btn btn-primary" role="button">
                                    喜欢
                                </a>
                                <a class="btn btn-default" role="button">
                                    不喜欢
                                </a>
                                <a class="btn btn-primary" role="button">
                                    吃过
                                </a>
                                <a class="btn btn-default" role="button">
                                    没吃过
                                </a>
                            </p>
                        </div>
                    </div>
                </div>
                <div class="col-md-6 col-sm-12">
                    <div class="thumbnail">
                        <img src="/content/images/豆沙月饼.jpg" />
                        <div class="caption">
                            <h3>豆沙月饼</h3>
                            <p>
                                <a class="btn btn-primary" role="button">
                                    喜欢
                                </a>
                                <a class="btn btn-default" role="button">
                                    不喜欢
                                </a>
                                <a class="btn btn-primary" role="button">
                                    吃过
                                </a>
                                <a class="btn btn-default" role="button">
                                    没吃过
                                </a>
                            </p>
                        </div>
                    </div>
                </div>
                <div class="col-md-6 col-sm-12">
                    <div class="thumbnail">
                        <img src="/content/images/冰皮月饼.jpg" />
                        <div class="caption">
                            <h3>冰皮月饼</h3>
                            <p>
                                <a class="btn btn-primary" role="button">
                                    喜欢
                                </a>
                                <a class="btn btn-default" role="button">
                                    不喜欢
                                </a>
                                <a class="btn btn-primary" role="button">
                                    吃过
                                </a>
                                <a class="btn btn-default" role="button">
                                    没吃过
                                </a>
                            </p>
                        </div>
                    </div>
                </div>

                <div class="col-md-6 col-sm-12">
                    <div class="thumbnail">
                        <img src="/content/images/双黄莲蓉月饼.jpg" />
                        <div class="caption">
                            <h3>双黄莲蓉月饼</h3>
                            <p>
                                <a class="btn btn-primary" role="button">
                                    喜欢
                                </a>
                                <a class="btn btn-default" role="button">
                                    不喜欢
                                </a>
                                <a class="btn btn-primary" role="button">
                                    吃过
                                </a>
                                <a class="btn btn-default" role="button">
                                    没吃过
                                </a>
                            </p>
                        </div>
                    </div>
                </div>
                <div class="col-md-6 col-sm-12">
                    <div class="thumbnail">
                        <img src="/content/images/巧克力月饼.jpg" />
                        <div class="caption">
                            <h3>巧克力月饼</h3>
                            <p>
                                <a class="btn btn-primary" role="button">
                                    喜欢
                                </a>
                                <a class="btn btn-default" role="button">
                                    不喜欢
                                </a>
                                <a class="btn btn-primary" role="button">
                                    吃过
                                </a>
                                <a class="btn btn-default" role="button">
                                    没吃过
                                </a>
                            </p>
                        </div>
                    </div>
                </div>
            </div>
            <p></p>
            <p></p>
            <div class="row">
                <a href="@Url.Action("Result")" class="btn btn-danger btn-lg btn-block" role="button">
                    查看统计结果
                </a>
                <p></p>
                <p class="text-center">
                    <h4 style="color:white;text-align:center;">亲，右上角分享哦！</h4>
                </p>
            </div>
            <p></p>
            <p></p>
            <p></p>

            @*<p>
                    <table class="table table-bordered">
                        <thead>
                            <tr>
                                <th class="col-xs-3">
                                    月饼名称
                                </th>
                                <th>
                                    投票数
                                </th>
                            </tr>

                        </thead>
                        <tbody>
                            @{
                                    List<string> list = new List<string>() {
                                    "五仁月饼",
                                    "水果月饼",
                                    "豆沙月饼",
                                    "冰皮月饼",
                                    "双黄莲蓉月饼",
                                    "巧克力月饼"
                                };
                                    IYueBing _IYueBing = ConcreteFactory.GetYueBing();
                                }

                            @foreach (var item in list)
                            {
                                int like = _IYueBing.GetCount_Like(item, true);
                                int notlike = _IYueBing.GetCount_Like(item, false);
                                int eat = _IYueBing.GetCount_Eat(item, true);
                                int noteat = _IYueBing.GetCount_Eat(item, false);
                                double likePercent = like + notlike;
                                if (likePercent > 0)
                                {
                                    likePercent = like*1.0/ likePercent * 100;

                                }
                                double eatPercent = eat + noteat;
                                if (eatPercent > 0)
                                {
                                    eatPercent = eat*1.0 / eatPercent*100;
                                }
                                <tr>
                                    <td>@item</td>
                                    <td>
                                        <h3>喜欢@(like)人，不喜欢@(notlike)人 @likePercent</h3>
                                        <div class="progress">
                                            <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80"
                                                 aria-valuemin="0" aria-valuemax="100" style="width: @(likePercent)%">
                                            </div>
                                        </div>
                                        <h3>吃过@(eat)人，没吃过@(noteat)人</h3>
                                        <div class="progress">
                                            <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80"
                                                 aria-valuemin="0" aria-valuemax="100" style="width: @(eatPercent)%">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </p>
                <p>

                </p>
                <p></p>
                <p></p>*@
        </div>
    </div>
    <script src="~/scripts/StorageHelper1.0.js"></script>
    <script src="~/scripts/ZhongQiu.js"></script>
</body>
</html>
